home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr28 / chkl10.zip / CHKLOCAL.PAS < prev    next >
Pascal/Delphi Source File  |  1995-01-11  |  1KB  |  76 lines

  1. Program ChkLocal;
  2. Uses Dos;
  3.  
  4. {$I Struct.200}
  5.  
  6. Var Rec     : MsgHdrRecord;
  7.     Inp     : File of MsgHdrRecord;
  8.     Out     : Text;
  9.     Chk     : Text;
  10.  
  11.     Conf    : ConfigRecord;
  12.     Tmp     : File;
  13.     RR      : Word;
  14.  
  15.     Subj    : String;
  16.     SysPath : PathStr;
  17.  
  18. Procedure CompletePath(Var P : PathStr);
  19. Begin
  20. P:=FExpand(P);
  21. If (Length(P)>2) And (P[Length(P)]<>'\')
  22.    Then P:=P+'\';
  23. End;
  24.  
  25. Begin
  26. WriteLn('LiveSystems Check Local attach directory 1.0');
  27. WriteLn('Public Domain');
  28. WriteLn;
  29.  
  30. SysPath:=GetEnv('RA');
  31. If SysPath=''
  32.    Then Halt;
  33. CompletePath(SysPath);
  34.  
  35. FileMode:=$40;
  36. Assign(tmp,SysPath+'CONFIG.RA');
  37. Reset(tmp,1);
  38. BlockRead(Tmp,Conf,SizeOf(Conf),RR);
  39. Close(Tmp);
  40. If RR=0
  41.    Then Halt;
  42.  
  43.  
  44. CompletePath(Conf.MsgBasePath);
  45. CompletePath(Conf.AttachPath);
  46.  
  47. Assign(Inp,Conf.MsgBasePath+'MSGHDR.BBS');
  48. Reset(Inp);
  49. If IoResult<>0
  50.    Then Halt;
  51.  
  52. Assign(Out,Conf.AttachPath+'DESCRIPT.ION');
  53. SetFAttr(Out,0);
  54. Rewrite(Out);
  55.  
  56. Assign(Chk,Conf.AttachPath+'CHECK.SUB');
  57. Rewrite(Chk);
  58.  
  59. While Not Eof(Inp) Do
  60.  Begin
  61.  Read(Inp,Rec);
  62.  If Pos(Conf.AttachPath,Rec.Subject)=1
  63.     Then Begin
  64.          Subj:=Rec.Subject;
  65.          Delete(Subj,1,Length(conf.AttachPath));
  66.          WriteLn(Out,Subj,' ',Rec.WhoFrom,' (',Rec.PostDate,', ',Rec.MsgNum,')');
  67.          End
  68.     Else WriteLn(Chk,Rec.PostDate,' ',Rec.Board:3,' ',Rec.Subject);
  69.  Write(#13,Rec.MsgNum);
  70.  End;
  71. Close(Inp);
  72. Close(Out);
  73. Close(Chk);
  74. End.
  75.  
  76.